package com.leyou.item.mapper;

import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.SelectByIdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @version V1.0
 * @author: Ljxpa
 * @date: 2020/03/03 18:27
 * @description:
 */
public interface CategoryMapper extends Mapper<Category>, SelectByIdListMapper<Category,Long> {
	@Select("select tc.id,tc.name,tc.sort,tc.is_parent,tc.parent_id from tb_category tc inner join tb_category_brand tcb on tc.id = tcb.category_id where tcb.brand_id = #{id}")
	List<Category> queryCategoriesByBrandId(@Param("id") Long id);
}
